package com.cookman;

import com.badlogic.gdx.backends.lwjgl.LwjglApplication;
import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration;
import com.badlogic.gdx.tools.texturepacker.TexturePacker;
import com.cookman.controllers.GameAlice;
import com.cookman.utils.Constants;

public class Main {
    public static void main(String[] args) {

       repack();

        LwjglApplicationConfiguration cfg = new LwjglApplicationConfiguration();
        cfg.title = "aliceui";
        cfg.useGL30 = false;
        cfg.vSyncEnabled = true;
        if (false) {
            cfg.width = 1920;
            cfg.height = 1080;
            cfg.fullscreen = true;//Constants.FULL_SCREEN;
        } else {
            cfg.width = Math.round(Constants.VIEWPORT_GUI_WIDTH);
            cfg.height = Math.round(Constants.VIEWPORT_GUI_HEIGHT);
        }
        cfg.resizable = false;
        //Gdx.graphics.setDisplayMode(1280, 720, true);
        GameAlice gameAlice = new GameAlice();

        new LwjglApplication(gameAlice, cfg);
    }

    private static void repack() {
        TexturePacker.Settings settings = new TexturePacker.Settings();

        settings.maxWidth = 2048;
        settings.maxHeight = 2048;
        settings.debug = false;

        TexturePacker.processIfModified(settings, "assets-raw/images", "../assets/images", "alice.atlas");
        TexturePacker.processIfModified(settings, "assets-raw/images-ui", "../assets/images", "aliceui.atlas");

        /*TexturePacker.process(settings, "assets-raw/images", "../assets/images", "alice.atlas");
        TexturePacker.process(settings, "assets-raw/images-ui", "../assets/images", "aliceui.atlas");*/
    }
}
